package com.boyon.common.status;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.boyon.common.domain.Value;

/**
 * ClassName:ReportType <br/>
 * Function: 分成比例类型. <br/>
 * Date: 2018年4月8日 下午9:23:27 <br/>
 * 
 * @author sunshulin
 * @version
 * @since JDK 1.8
 * @see
 */
public enum ReportType {

	charge(0, "收费"), free(1, "免费");

	private Integer val;

	private String desc;

	private static Map<Integer, ReportType> values = new HashMap<>();

	private static List<Value> list = new ArrayList<>();

	static {
		values.put(ReportType.charge.getVal(), ReportType.charge);
		values.put(ReportType.free.getVal(), ReportType.free);
		list.add(new Value(ReportType.charge.getVal(), ReportType.charge.desc));
		list.add(new Value(ReportType.free.getVal(), ReportType.free.desc));
	}

	/**
	 * Creates a new instance of ReportType.
	 * 
	 * @param status
	 * @param desc
	 */
	private ReportType(Integer val, String desc) {
		this.val = val;
		this.desc = desc;
	}

	/**
	 * status.
	 * 
	 * @return the status
	 * @since JDK 1.8
	 */
	public Integer getVal() {
		return val;
	}

	/**
	 * desc.
	 * 
	 * @return the desc
	 * @since JDK 1.8
	 */
	public String getDesc() {
		return desc;
	}

	/**
	 * 
	 * getType:获取枚举类型. <br/>
	 * 
	 * @author sunshulin
	 * @param val
	 * @return
	 * @since JDK 1.8
	 */
	public static ReportType getType(Integer val) {
		return values.get(val);
	}

	/**
	 * list.
	 * 
	 * @return the list
	 * @since JDK 1.8
	 */
	public static List<Value> getList() {
		return list;
	}
}
